//
//  RootTabBarController.swift
//  Story
//
//  Created by 汤泽川 on 2019/3/30.
//  Copyright © 2019 汤泽川. All rights reserved.
//

import Foundation
import UIKit

class RootTabBarController: UITabBarController {
    
    override func viewDidLoad() {
        self.setupTabBar()
    }
    
    func setupTabBar() {

        let feedTab = FeedViewController()
        feedTab.tabBarItem = UITabBarItem(title: "广场", image: #imageLiteral(resourceName: "story_feed"), selectedImage: nil)
        let feedNav = UINavigationController(rootViewController: feedTab)
        let creativeCenterTab = CreativeCenterViewController()
        creativeCenterTab.title = "写文章"
        creativeCenterTab.tabBarItem = UITabBarItem(title: "写作", image: #imageLiteral(resourceName: "story_creative_center"), selectedImage: nil)
        let creativeCenterNav = UINavigationController(rootViewController: creativeCenterTab)
        let mineTab = MineViewController()
        mineTab.tabBarItem = UITabBarItem(title: "我的", image: #imageLiteral(resourceName: "story_mine"), selectedImage: nil)
        let mineNav = UINavigationController(rootViewController: mineTab)
        let viewControllers = [feedNav, creativeCenterNav, mineNav]
        self.setViewControllers(viewControllers, animated: true)
    }
}
